package com.xiaoshuidi.cloud.module.contract.enums.contract;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 电子合同状态的枚举类
 *
 * @author 合房源码
 */
@Getter
@AllArgsConstructor
public enum ElectronicContractStatusEnum {
    UNSIGNED(0, "未签署"),
    LANDLORD_SIGNED(1, "甲方已签署"),
    BOTH_SIGNED(2,"双方已签署"),
    ;

    private Integer code;
    private String msg;

    public static String getName(Integer code) {
        for (ElectronicContractStatusEnum c : ElectronicContractStatusEnum.values()) {
            if (c.getCode().intValue() == code.intValue()) {
                return c.msg;
            }
        }
        return null;
    }
}
